package com.atguigu.cloud.service.impl;

import com.atguigu.cloud.entity.po.Pay;
import com.atguigu.cloud.mapper.PayMapper;
import com.atguigu.cloud.service.PayService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Jungle
 * @create 2024-04-01 7:54
 */
@Service
public class PayServiceImpl implements PayService {
    @Resource
    private PayMapper mapper;

    @Override
    public int add(Pay pay) {
        return mapper.insertSelective(pay);

    }

    @Override
    public int delete(Long id) {
        return mapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Pay pay) {
        return mapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay getById(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Pay> getAll() {
        return mapper.selectAll();
    }
}
